#include "global.h"
#include "StrView.h"

using namespace std;

int main()
{
	string s1 = "123123212";
	StrView v1{ s1, 0, 2 };
	StrView v2{ s1, 3, 5 };
	StrView v3{ s1, 7, 9 };
	cout << v1 << " " << hHash(v1) << endl;
	cout << v2 << " " << hHash(v2) << endl;
	cout << v3 << " " << hHash(v3) << endl;
	string s2 = "12";
	cout <<hash<string>{}(s2) << endl;
	cout <<hash<string_view>{}(string_view(s2)) << endl;
	unordered_map<StrView, size_t, HHash<StrView>> m;
	++m[v1];
	++m[v2];
	++m[v3];
	for (auto& [v, n] : m)
		cout << v << ":" << n << endl;

	return 0;
}